/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author zouafr
 */
public class FirstActionForm extends org.apache.struts.action.ActionForm {
    
   
    private String login;
    private String mdp;
    private String statut;
    private Boolean FailEtu;
    private Boolean FailEns;

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getMdp() {
        return mdp;
    }

    public void setMdp(String mdp) {
        this.mdp = mdp;
    }

    public String getStatut() {
        return statut;
    }

    public void setStatut(String statut) {
        this.statut = statut;
    }

    public Boolean getFailEtu() {
        return FailEtu;
    }

    public void setFailEtu(Boolean FailEtu) {
        this.FailEtu = FailEtu;
    }

    public Boolean getFailEns() {
        return FailEns;
    }

    public void setFailEns(Boolean FailEns) {
        this.FailEns = FailEns;
    }

    public FirstActionForm() {
        this.FailEtu = false;
        this.FailEns = false;
    }
    
    

    
      

    /**
     * This is the action called from the Struts framework.
     *
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getLogin() == null || getLogin().length() < 1) {
            errors.add("error.name", new ActionMessage("error.name.required"));
            // TODO: add 'error.name.required' key to your resources
        }
 
        if (getMdp() == null || getMdp().length() < 1) {
            errors.add("error.mdp", new ActionMessage("error.mdp.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        

        return errors;    
    }
}

